# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-daemon
_pkgname=${pkgname//-/_}
pkgver=1.2
pkgrel=1
pkgdesc='Library to implement a well-behaved Unix daemon process'
arch=('any')
url='https://pypi.python.org/pypi/python-daemon'
license=('Apache')
depends=('python' 'python-lockfile' 'python-setuptools')
makedepends=('python-build' 'python-docutils' 'python-installer' 'python-wheel'
             'python-changelog-chug')
checkdepends=('python-testscenarios' 'python-testtools')
source=("https://files.pythonhosted.org/packages/source/p/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('7062bbf672668591be9b6cc2f0175b5ba7be0ddf62589fa0433d624b2c7507076a40733fb43d8b3726166a5563aae615c06e9e2974798bcff690c2e4627231fd')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --no-isolation
}

package() {
  cd "$_pkgname-$pkgver"

  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm 644 LICENSE.ASF-2 \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE.ASF-2"
  install -Dm 644 LICENSE.GPL-3 \
  "$pkgdir/usr/share/licenses/$pkgname/LICENSE.GPL-3"
}

